package com.kukajenny.bobozan;

import android.app.FragmentManager;
import android.app.FragmentTransaction;
import android.content.Intent;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;

public class MainActivity extends AppCompatActivity implements View.OnClickListener {



    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);

        Button create = (Button)findViewById(R.id.create_button);
        create.setOnClickListener(this);

        Button join = (Button)findViewById(R.id.join_button);
        join.setOnClickListener(this);
    }


    @Override
    public void onClick(View view) {
        Intent intent = new Intent(MainActivity.this,RoomActivity.class);
        switch (view.getId()){
            case R.id.create_button:
                intent.putExtra("from",0);
                break;
            case R.id.join_button:
                intent.putExtra("from",1);
                break;
        }
        startActivity(intent);
    }
}
